Skip to content

fix(codex): handle large sessions and correct skill invocation - #20

Merged
phodal merged 2 commits into
QoderAI:mainfrom
and0rw:fix/codex-session-analysis-and-docs
Jul 29, 2026
Merged

fix(codex): handle large sessions and correct skill invocation#20
phodal merged 2 commits into
QoderAI:mainfrom
and0rw:fix/codex-session-analysis-and-docs

Conversation

@and0rw

@and0rw and0rw commented Jul 29, 2026

Copy link
Copy Markdown
Contributor

Summary

  • Avoid V8's argument limit when the Codex session analyzer aggregates a large session.
  • Correct Codex Desktop and Codex CLI Better Harness invocation examples in both READMEs.

Why

  • Issue/Story: None provided.
  • User or maintainer outcome: Large Codex sessions complete analysis instead of throwing RangeError: Maximum call stack size exceeded; Codex users receive host-specific invocation syntax.

Traceability and Scope

  • Spec/ADR, if applicable: None. This is a narrow maintenance fix.
  • Acceptance criteria addressed:
    • A synthetic 150,000-event Codex session analyzes successfully and preserves aggregate and per-session event counts.
    • Codex Desktop examples use @better-harness and Codex CLI examples use $better-harness:better-harness in English and Simplified Chinese.
    • Other hosts' /better-harness examples remain unchanged.
  • Canonical owners changed: scripts/session-analysis/platforms/codex.mjs, README.md, README.zh-CN.md, and focused regression tests.
  • Explicit non-goals: Changes to other provider analyzers, SKILL.md, plugin manifests, generic slash-command examples, and release metadata.

Change Type

  • Bug fix
  • Feature
  • Tests only
  • Documentation/community
  • Refactor with no intended behavior change
  • Dependency, packaging, or infrastructure

Test and Review Evidence

Check Result
node --test test/session-analysis.test.mjs test/session-analysis-core-facts.test.mjs test/better-harness-evidence-bundle.test.mjs test/better-harness-skill.test.mjs Passed
npm test Passed: 835 tests
npm run pack:verify Passed: npm 303 entries, runtime ZIP 330 entries
Codex CLI smoke test Passed: $better-harness:better-harness returned BETTER_HARNESS_CLI_SMOKE_OK in an ephemeral read-only task

Manual or visual evidence: the Codex Desktop Better Harness skill resolved in the active task; the CLI invocation was exercised with Codex CLI 0.145.0.

Risk and Recovery

  • Compatibility and cross-platform impact: The analyzer change is standard JavaScript array iteration; documentation is host-specific and leaves other host syntax unchanged.
  • Package, plugin, schema, or generated-file impact: No manifest, schema, or generated-file changes; package verification passed.
  • Rollback or recovery path: Revert 6afe786 and/or 4d14212 independently.
  • Residual risk or unverified boundary: Maintainer review remains pending; no changes were made to analogous non-Codex aggregation paths.

AI Involvement

  • Level: Generated
  • Human review and validation: Maintainer review pending; automated validation is listed above.

Checklist

  • I followed AGENTS.md, CONTRIBUTING.md, and the relevant canonical-owner guidance.
  • The change is focused and does not include unrelated local or generated state.
  • Tests and documentation match the behavior actually delivered.
  • Markdown links were checked when documentation changed.
  • Cross-platform behavior was considered for Windows, macOS, and Linux.
  • Package/runtime verification was run when shipped files or dependencies changed.
  • User-facing or compatibility changes are recorded in CHANGELOG.md (documentation correction only; out of scope for this PR).
  • I have the right to contribute this work under the repository's MIT License.

codex added 2 commits July 28, 2026 22:24
Append Codex session events iteratively so large session arrays do not cross V8's argument limit. Add a 150,000-event regression that checks both merged-session and aggregate counts.

Validated with node --test test/session-analysis.test.mjs test/session-analysis-core-facts.test.mjs test/better-harness-evidence-bundle.test.mjs.
Document the host-specific Better Harness invocation for Codex Desktop and Codex CLI in both README languages. Keep slash-command examples for other hosts unchanged and add regression coverage for the Codex sections.

Validated with node --test test/session-analysis.test.mjs test/session-analysis-core-facts.test.mjs test/better-harness-evidence-bundle.test.mjs test/better-harness-skill.test.mjs.
@phodal
phodal merged commit 52e6996 into QoderAI:main Jul 29, 2026
4 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants